<!--{Atemplate tpl/header}-->

<!--{eval echo $this->Ahtml_js_aurl();}-->
<!--{Atemplate member/area}-->
<script>
var columns = {"$this->model->table":$column_json};
var url_info = '$this->Amodr-info-';
var model = $listjson;
function checkall(value) {
	if(value=='0'){
		jQuery(".checkbox").attr("checked","checked");
		jQuery("#chkall_del").removeAttr("disabled","disabled");
	}
	if(value=='1'){
		jQuery(".checkbox").removeAttr("checked","checked");
		jQuery("#chkall_del").attr("disabled","disabled");
	}
	if(value=='auth'){
		var chkall = jQuery("input:checked").val();
		if(chkall == null){
			alert('请先选择');
			return false;
		}else{
			return true;
		}
	}
}

function getids(url,oid){
	if(!oid){
		var oid = jQuery("#oid").val();
	}
	Atab.task_new(oid,"http://weibo.com/"+oid+'/'+url+"?page=1",1);
}
function viewinfo(oid){
	Atab.task_new(oid,"http://weibo.com/"+oid+'/info',1);
}
//--抓取用户信息
var arr = [];
var i = 0;
function getchkinfo(){
	arr = [];
	jQuery(".checkbox:checked").each(function(i){
		var id = jQuery(this).val();
		arr[i] = jQuery('#data-'+id+'-oid span').text();
	})
	if(arr.length > 0)
		news();
}
function news(){
	if(arr.length==i){i=0; return;}
	url = "http://weibo.com/"+arr[i]+"/info";
	Atab.task_new(arr[i],url,0);
	setTimeout('news()',200);
	i++;
}

jQuery(function(){
	jQuery(".checkbox").change(function (){
		if(jQuery("input:checked").val()){
			jQuery("#chkall_del").removeAttr("disabled","disabled");
		}else{
			jQuery("#chkall_del").attr("disabled","disabled");
		}
	});
})
var Awform = new Apps.form('weibo','Awform',{'add':{width:640,height:'auto'}},columns.$this->model->table);
jQuery(document).ready(function(){

});
</script>
<form action="" method="get" class="_weibotop">
	<input type="button" value="栏目设置" onclick="Awform.column()"/>
	<input type="button" value="添加" onclick="Awform.add()"/>
	地区：<span id="search_area"></span>
	性别：
	<!--{form 'select','sex',$sex,'',$post[sex]}--> 
	星座：
	<!--{form 'select','xinzuo',$xinzuo,'',$post[xinzuo]}--> 
	状态：
	<!--{form 'select','status',$status,'',$post[status]}--> 
	<select name="sop">
		<option value="">模糊查询</option>
		<!--{loop $column_sop $key $val}-->
		<option value="$key" <!--{if $key==$post[sop]}-->selected="selected"<!--{/if}-->>$val</option>
		<!--{/loop}-->
	</select>
	<input type="text" name="search" value="$post[search]" size="20"/>
	<input type="submit" value="搜索">
</form>
<div class="_data_column dis_none">
	<div class="_list">$column_html</div>
	<input type="submit" value="确定"/>
</div>
<div class="_weibo_list">
<form action="" method="POST">
<table class="-table">
	<tr>
		<th><b>管理</b></th>
	<!--{loop $column $key $val}-->
		<th><b><a href="$page->theurl-aorder-$key,$pages->neworder$pages->other">$val</a></b></th>
	<!--{/loop}-->
	</tr>
<!--{loop $list $key $val}-->
<!--{eval
$mid = $val->$key_name;
}-->
	<tr>
		<td>
			<input type="button" value="粉丝" onclick="getids('fans',$val->oid)">
			<input type="button" value="关注" onclick="getids('follow',$val->oid)">
			<input type="button" value="浏览" onclick="viewinfo($val->oid)">
			<input type="button" onclick="Awform.add('$mid')" value="编辑" id=""/>
			<!--<input type="button" value="删除" onClick="javascript:if(confirm('确实要删除吗?')) Awform.del('$mid');" />-->
		</td>
		<!--{eval echo $obj->for_html($key,$val,$column,$this->model,'Awform');}-->
		<input type="hidden" name="save[{$key}][id]" size="1" value="$val->id">
	</tr>
<!--{/loop}-->
	<tr>
		<td colspan="20">
			<input type="button" onclick="javascript:checkall(0);" value="全选" >
			<input type="button" onclick="javascript:checkall(1);" value="反选">
			<input type="button" onclick="javascript:getchkinfo();" value="抓取选择信息">
			<input type="submit" id="chkall_del" disabled="disabled" value="删除选择" onClick="javascript:form.action='$this->Amodr-delall';" />
			<input type="submit" value="错误用户" onClick="javascript:form.action='$this->Amodr-error';" />
		</td>
	</tr>
</table>
</form>
</div>

<div class="_weibonav">
	<span class="_info">客户条数：$page->counts</span>
	<div class="_page">
		$pages->html
		<!--<input type="number" size="8">
		<input type="button" value="跳转">-->
	</div>
	<div class="_menu">
		<p><!--<a  href="http://{Acan_site_url}" target="_blank">{Acan_site_url}</a>-->
		<!--{eval Afun_runtime_html();}--></p>
	</div>
</div>


<!--{Atemplate tpl/nofooter}-->